<!DOCTYPE html>
<html lang="en" th:replace="~{layout.html::layout(~{:: #content})}">

<body>
<div class="container-fluid" id="content">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li class="active"><a href="index">借阅信息</a></li>
                <li><a href="students">学生列表</a></li>
                <li><a href="books">书籍列表</a></li>
            </ul>

        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1 class="page-header">借阅信息总览</h1>

            <div class="row placeholders">
                <div class="col-xs-6 col-sm-3 placeholder" style="border:3px solid #428bca">
                        <h4>书籍数量</h4>
                        <span class="text-muted" th:text="${bookNum}">Something else</span>

                </div>
                <div class="col-xs-6 col-sm-3 placeholder" style="border:3px solid #428bca">
                    <h4>学生人数</h4>
                    <span class="text-muted" th:text="${studentNum}">Something else</span>
                </div>
                <div class="col-xs-6 col-sm-3 placeholder" style="border:3px solid #428bca">
                    <h4>总借阅数</h4>
                    <span class="text-muted" th:text="${borrowNum}">Something else</span>
                </div>
            </div>

            <h2 class="sub-header">借阅信息列表</h2>
            <a href="add-borrow" class="btn btn-success">添加借阅记录</a>
            <br/>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>书籍编号</th>
                        <th>书名</th>
                        <th>借阅时间</th>
                        <th>学号</th>
                        <th>学生姓名</th>
                        <th>归还情况</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="borrow:${borrowList}">
                        <td th:text="${borrow.getBookId()}">书id</td>
                        <td th:text="${borrow.getBookName()}">书名</td>
                        <td th:text="${borrow.getTime()}">借阅时间</td>
                        <td th:text="${borrow.getStudentId()}">学号</td>
                        <td th:text="${borrow.getStudentName()}">姓名</td>
                        <td th:text="${borrow.getBack()?'已归还':'未归还'}">归还情况</td>
                        <td>
                            <span>
                                <a th:href="'delete-borrow?id='+${borrow.getId()}" class="btn btn-xs btn-danger" >删除</a>
                            </span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

</body>
</html>